<template>
<h1>单选组件</h1>
  <el-radio-group v-model="gender">
  <el-radio label="男" value="1"></el-radio>
  <el-radio label="女" value="0"></el-radio>
  </el-radio-group>
  <h4>您选择的性别是:{{gender}}</h4>
  <hr>
  <el-radio-group v-model="edu">
    <el-radio-button label="学历:专科" value="zk"></el-radio-button>
    <el-radio-button label="学历:本科" value="bk"></el-radio-button>
    <el-radio-button label="学历:硕士" value="ss"></el-radio-button>
    <el-radio-button label="学历:博士" value="bs"></el-radio-button>
  </el-radio-group>
  <h4>请选择您的学历:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="price">
    <el-radio-button v-for="p in arr" :label="p.title" :value="p.price"></el-radio-button>
  </el-radio-group>
  <h4>您选择的酒价为:{{price}}</h4>
</template>


<script setup>
import {ref} from "vue";

const gender =ref('');
//定义变量用来保存用户选择的学历
const edu = ref('');

const arr =ref([
  {title:'五粮液',price:'500'},
  {title:'茅台',price:'2500'},
  {title:'汾酒',price:'330'},
  {title:'梦之蓝',price:'368'}
]);

const price = ref('')
</script>



<style scoped>

</style>